{
 "cells": [
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "温馨提示：\n",
    "1. 不要改动题目，作答请在题目下面这个单元格内作答。\n",
    "2. 请及时点左上角的保存按钮\n",
    "3. 完成所有答题之后，将此文件保存，然后钉钉私信发给於明亮即可结束考试。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "姓名:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "一级部门:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "工号:\n",
    "4位"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "1. 编程题：请把下图的 Inst360 公司的名字打印出来。（3分）\n",
    "\n",
    "  ___           _        _____  __    ___  \n",
    " |_ _|_ __  ___| |_ __ _|___ / / /_  / _ \\ \n",
    "  | || '_ \\/ __| __/ _` | |_ \\| '_ \\| | | |\n",
    "  | || | | \\__ \\ || (_| |___) | (_) | |_| |\n",
    " |___|_| |_|___/\\__\\__,_|____/ \\___/ \\___/ "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 作答区\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "2. 编程题：使用 print() 函数，打印【 Let's play. 】 这些字。(中括号里面的英文句子) （2分）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": [
    "# 作答区\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "3. 编程题：使用 for循环或while循环 求 10000 以内偶数的和。（5分）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": [
    "# 作答区\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "4. 编程题：请使用 转义字符\\n（换行符），把下面这首诗打印出来（4分）\n",
    "\n",
    "红军不怕远征难，\n",
    "万水千山只等闲。\n",
    "五岭逶迤腾细浪，\n",
    "乌蒙磅礴走泥丸。\n",
    "金沙水拍云崖暖，\n",
    "大渡桥横铁索寒。\n",
    "更喜岷山千里雪，\n",
    "三军过后尽开颜。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": [
    "# 作答区\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "5.下面，是一串程序的运行结果。请根据运行结果来反推出它的代码应该怎么写：（5分）\n",
    "    \n",
    "输入一个你错过的人:紫霞仙子\n",
    "输入你最想对ta说的话:我爱你\n",
    "输入一个时⻓(比如三分钟):一万年\n",
    "\n",
    "曾经有一份真挚的爱情放在我面前，那个人的名字是紫霞仙子 \n",
    "可我没有珍惜，如果上天能再给我一次机会，我会对ta说一句话:我爱你 \n",
    "如果非要给这句话加上一个期限，我希望是一万年"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 作答区\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "6. 多选题：（3分）\n",
    "下面哪几个是 python 中合法的变量名字 （ ）\n",
    "A. message_1  B. 1_message  C. message 1  D. _massage_1"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "答案：\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "7. 填空题 请把问号 ? 替换成你的答案。（6分）\n",
    "\n",
    "设 companys = ['Google', 'Runoob', 'Taobao', 'Baidu', 'Tengxun','Meituan','Toutiao']\n",
    "\n",
    "如果要从列表 companys 中取出 ['Meituan','Toutiao']，应该怎么做，请写出 3种写法。"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "答案：\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "8. 编程题 （6分）\n",
    "定义一个函数 sequential_output(x,y,z)，输入三个整数x,y,z，把这三个数由小到大输出\n",
    "比如 \n",
    "输入 sequential_output(5,1,7) ,输出 1,5,7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": [
    "# 作答区\n",
    "# 撰写代码的时候，把 pass 删除，然后再 pass 的位置继续撰写代码。\n",
    "\n",
    "def  sequential_output(x,y,z):\n",
    "    pass\n",
    "\n",
    "    \n",
    "sequential_output(5,1,7)  # 会输出 1,5,7\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "9. 编写一个成绩评价系统，当输入语文、数学和英语三门课程成绩时，输出三门课程总成绩及其等级。（8分）\n",
    "\n",
    "(1) 程序提示用户输入三个数字，数字分别表示语文、数学、英语分数，对应的变量名称是Chinese、Math、English，并计算三个分数的和(score)进行输出。\n",
    "\n",
    "注：input()函数中分别添加 “数学：”，“语文：”，“英语：”，如input(“语文:”)。\n",
    "\n",
    "(2) 查看下方的成级对照表，比较score，输出对应区间的等级\n",
    "总分大于等于 270，优秀\n",
    "总分大于等于 240分，但小于270分，良好\n",
    "总分大于等于 180分，但小于240分，合格\n",
    "总分小于 180 分，不合格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": [
    "# 作答区\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "10.使用循环方法求解百钱买百鸡问题。假设公鸡5元一只，母鸡3元一只，小鸡1元三只，（8分）\n",
    "\n",
    "现有100元钱想买100只鸡，编程计算买鸡的方案，有多少种买法？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 作答区\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "11.【题目】 10分\n",
    "使用Pyhton代码来演示恋爱过程: \n",
    "\n",
    "首先判断:两人的关系是不是达到了【朋友之上，恋人未满】? \n",
    "如果不是，那么输出:进度条还不够，再等等。程序终结。 \n",
    "如果是，那么再判断:你是不是想和对方有进一步的发展? \n",
    "如果不是，那么输出:还是做朋友吧。程序终结。 \n",
    "如果是，那么再判断:对方是不是想有进一步的发展? \n",
    "如果不是，那么输出:恭喜获得“好人卡”。 \n",
    "如果是，那么输出:恭喜你们，有情人终成眷属!\n",
    "    \n",
    "【提示】\n",
    "1. 条件判断的使用:if...elif...elif...else\n",
    "2. 使用input()函数，不需要赋值也可以直接进行条件判断。比如:if input('吃了吗?')=='吃了':"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 作答区\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "12. 多选题：（6分）\n",
    "\n",
    "有列表L = [1,2,3,4,5,6]，现要删除值为3的元素，请提供3中方法"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "答案：\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "13.编程题：（6分） \n",
    "\n",
    "请你通过所学知识，把列表中的 “猎人” 和 '邻国公主' 分别取出来，并分别打印出来\n",
    "townee = [\n",
    "    {'海底王国':['小美人鱼''海之王''小美人鱼的祖母''五位姐姐'],'上层世界':['王子','邻国公主']},\n",
    "    '丑小鸭','坚定的锡兵','睡美人','青蛙王子',\n",
    "    [{'主角':'小红帽','配角1':'外婆','配角2':'猎人'},{'反面角色':'狼'}]\n",
    "    ]\n",
    "\n",
    "提示：print(townee[5][1]['反面角色']) 可以取出 \"狼\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": [
    "# 作答区\n",
    "\n",
    "townee = [\n",
    "    {'海底王国':['小美人鱼''海之王''小美人鱼的祖母''五位姐姐'],'上层世界':['王子','邻国公主']},\n",
    "    '丑小鸭','坚定的锡兵','睡美人','青蛙王子',\n",
    "    [{'主角':'小红帽','配角1':'外婆','配角2':'猎人'},{'反面角色':'狼'}]\n",
    "    ]\n",
    "\n",
    "# 请在下面补充你的代码\n",
    "\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "14. 编程题（8分）\n",
    "\n",
    "功能是请用户输入密码，如果输入了错误的密码，就一直循环请用户继续输入；\n",
    "如果输入了正确的密码，就结束循环。设定这个密码为'前海人寿'。\n",
    "\n",
    "提示：\n",
    "① 用 while True 开启无限循环。\n",
    "② 在循环内部用input() 函数获取用户的数据。 \n",
    "③ 使用if...break，如果变量 password == '前海人寿'，那就break结束循环。否则又开始循环。\n",
    "④ 结束循环后，打印\"通过啦\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": [
    "# 作答区\n",
    "\n",
    "while True:\n",
    "    pass\n",
    "\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "15. 编程题（10分）\n",
    "一次测评中，老师将 学习小组A 和 学习小组B 的测评成绩 (满分 100 分) 从低到高记录放进两个列表：\n",
    "\n",
    "Class_A=[43, 55, 76, 99]，Class_B=[24, 54, 96, 98] 。\n",
    "\n",
    "现在，请把 A组 和 B组 低于所有成绩平均数的分数放进一个列表，并按照从低到高的顺序排序。\n",
    "\n",
    "提示：平均数可以用 numpy 里面的 mean 函数计算，用法如下\n",
    "import numpy\n",
    "aa = [1,2,3,4,5,6]\n",
    "print(numpy.mean(aa))\n",
    "\n",
    "# 会输入 3.5\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": [
    "# 作答区\n",
    "import numpy\n",
    "\n",
    "Class_A=[43, 55, 76, 99]\n",
    "Class_B=[24, 54, 96, 98] \n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "16.  编程题：（10分）\n",
    "寻找水仙花数\n",
    "\n",
    "> **说明**：水仙花数也被称为超完全数字不变数、自恋数、自幂数、阿姆斯特朗数，它是一个3位数，该数字每个位上数字的立方之和正好等于它本身，例如：1<sup>3</sup> + 5<sup>3</sup> + 3<sup>3</sup> = 153。\n",
    "\n",
    "这个题目的关键是将一个三位数拆分为个位、十位、百位，这一点利用Python中的`//`（整除）和`%`（求模）运算符其实很容易做到，代码如下所示。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "Collapsed": "false"
   },
   "outputs": [],
   "source": [
    "# 作答区\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {
    "Collapsed": "false"
   },
   "source": [
    "温馨提示：\n",
    "完成所以答题后，请把此文件保存。右键此文件 rename，把此文件名字改成 姓名+ python考试题.ipynb.  然后发送给於明亮。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
